1. Field of the Invention
The present invention relates to an apparatus and a method for measuring a driving amount of a motor, in which a relative driving amount of the motor is measured by use of an encoder of an increment type.
2. Description of the Prior Art
Encoders have widely been used for measuring such a driving amount of a motor as a displacing amount or a velocity of a body driven by a motor. Particularly, in such a case that many encoders are used whereby costs therefor is increased, encorders of an increment type are utilized. In this case, the driving amount of the motor has been measured in the prior arts as follows:
An industrial robot to which the apparatus according to a prior method is applied is shown in FIG. 1, in which an arm 10 thereof is driven by a motor 14 mounted on a joint portion 12 and an attitude of the arm 10 is controlled in response to a position command signal 100 put out from a position command signal output circuit 16. That is, the position command signal 100 from the position command signal output circuit 16 is compared with a feedback amount 102 supplied from a feedback system in a comparator 18, a compare output 104 corresponding to a deviation of the feedback amount 102 to the position command signal 100 is supplied from the comparator 18 to a digital to analog converter (hereinafter referred to as D/A converter) 20 wherein the compare output 104 is converted to an analog value, and the analog value is supplied to a driver 22 so that the motor 14 is driven by the driver 22. As a result, the arm 10 is controlled to its attitude responding to the positon command signal 100.
For the purpose of obtaining the feedback amount 102, an apparatus for measuring a driving amount of a motor according to the prior art is utilized, in which an encoder of an increment type 24 is connected directly to a driving shaft of the motor 14. The encoder 24 functions to put out driving amount pulses 106 of the number corresponding to a driving amount, i.e. a rotation angle, of the motor 14 and also functions to put out a reference pulse 108 (which is put out at a position responding to the origin of the motor) in each predetermined interval of the driving amount pulses 106 (one rotation herein).
The position where the reference pulse 108 is put out is defined as an electrical origin of the encoder 24. The driving amount pulses 106 are supplied to a counter 26 in which the number of the driving amount pulses 106 is counted, the feedback amount 102 is obtained from the counted number and thereafter it is supplied to the comparator 18.
In such an apparatus, if the number of the driving amount pulses 106 of the encoder 24 is merely counted by the counter 26, a mechanical origin of the arm 10 does not correspond to the electrical origin of the encoder 24. Accordingly, the counted number can not be utilized, as the feedback amount 102, for which the apparatus is constructed such that the fitting of the above two origins can be carried out in the following manner.
As shown in FIG. 1, the apparatus is provided with an origin-fitting command circuit 28 and an origin-fitting command signal 110 put out therefrom is supplied to a counter zero-setting circuit 30 and also to a fine speed rotation command circuit 32. The counter zero-setting circuit 30 is capable of setting a zero-setting signal 112 in the counter 26 and the fine speed rotation command circuit 32 is capable of giving to the D/A converter 20 a fine speed rotation command signal 114 so as to control the the motor 14 to its fine speed rotation. In addition, the apparatus is provided with a dog 34 driven together with the driving shaft of the motor 14 and the arm 10, and, when the dog 34 together with the arm 10 is driven and the arm 10 is moved to a neighborhood of the mechanical origin of the arm 10, the switch 36 is switched on so that an origin vicinity detecting signal 116 is supplied to the counter zero-setting circuit 30 to which the reference pulse 108 is also supplied.
Description will now be given of operation of the apparatus according to the prior method:
First, the mechanical origin of the arm 10 is precisely set by use of a levelling instrument, a transit instrument or the like. Next, with the driving shaft of the motor 14 driven, it is made sure by such an instrument as an oscilloscope that the reference pulse 108 is put out from the encoder 24, and thereafter a motor unit containing the motor 14 and the encoder 24 is mounted on the arm 10. Sequentially, the position of the dog 34 is adjusted such that the switch 36 is switched on in the vicinity of the mechanical origin Os. Furthermore, in these conditions, the counter 26 is reset, or set to zero. Thus, the motor unit is assembled to the robot.
When such an accident as an instantaneous power stoppage happens while the robot is working, the work of the robot is interrupted and the arm 10 is stopped in the position interrupted. At this time, the contents of the counter 26 is cleared due to the power stoppage whereby the correspondence of the mechanical origin of the arm 10 and the electrical origin of the encoder 24 is broken. Therefore, the origin indication to the robot is carried out as follows;
First, the arm 10 is moved by a manual operation until the switch 36 is switched on so that the driving shaft of the motor 14 is set to the neighborhood of the mechanical origin. Next, the origin-fitting command signal 110 is put out from the origin-fitting command circuit 28 to be supplied to the fine speed rotation command circuit 32 and the fine speed rotation command signal 114 put out from the fine speed rotation command circuit 32 is supplied to the driver 22 so that the motor 14 is rotated with a fine velocity. When the encoder 24 reaches the mechanical origin Os during the fine velocity rotation of the motor 14 and the reference pulse 108 is put out, the zero-setting signal 112 is put out from the counter zero-setting circuit 30 whereby the counter 26 is set to zero, or reset. Thus, the origin indication is completed.
After the completion of the origin indication, if the motor 14 is driven in response to the position command signal 100 put out from the position command signal output circuit 16, the counted number of the counter 26 corresponds to the relative driving amount based upon the mechanical origin of the motor 14. The relative driving amount is utilized as the feedback amount 102 whereby the arm 10 is controlled precisely to its attitude responding to the position command signal 100.
As set forth above, in the prior art since such a driven body as the arm 10 of the robot must be moved manually up to the small region where the origin-fitting can be carried out, it is difficult to conduct the origin-fitting and a long time is taken therefor.
Particularly, in case that the prior art is applied to the robot, as shown in FIG. 1, it is generally rare for the robot to work in the vicinity of the origin in view of the working area of the robot. Furthermore, in such a case that the power source for the robot is suddenly cut off during the work of the robot the arm 10 must be moved manually up to the region for the purpose of the origin-fitting while the arm 10 is being subjected to operation avoiding obstacles, which are not easy. Accordingly, a long time is taken for the origin indication in the prior art.